//
//  MLXExtension.m
//  Pods
//
//  Created by SY on 2018/12/10.
//

#import "NSURL+MLXExtension.h"

@implementation NSURL (MLXExtension)

+(NSURL *)getImageUrl:(NSString *)imageUrl domain:(NSString *)domainStr{
    if ((imageUrl == nil) && (imageUrl.length == 0)) return nil;
    NSURL *resultUrl = nil;
    NSRange schemeMarkerRange = [imageUrl rangeOfString:@"://"];
    if (schemeMarkerRange.location == NSNotFound) {
        if (domainStr ==nil && domainStr.length == 0) {
            domainStr = @"https://taoyou-resources.oss-cn-hangzhou.aliyuncs.com";
        }
        imageUrl = [NSString stringWithFormat:@"%@/%@",domainStr,imageUrl];
    }
    resultUrl = [NSURL URLWithString:imageUrl];
    return resultUrl;
}
@end
